home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / amipro3 / macros.cmz / FREPLACE.SMM < prev    next >
Encoding:
INI File  |  1992-11-18  |  7.2 KB  |  497 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     _macro.sty
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     PostScript Printer
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     Realiza b<\z>squedas y sustituciones en varios archivos a la vez.
  19.     Lotus WPD Marketing
  20.     Intermediate
  21.     Replace, FileOpen, Local Arrays
  22.     noautorun
  23.     714788355
  24.     31
  25.     676699899
  26.     103
  27.     2
  28.     0
  29.     0
  30.     0
  31.     0
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     0
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [tag]
  54.     Est<\a>ndar
  55.     5
  56.     [fnt]
  57.         Tms Rmn
  58.         240
  59.         0
  60.         49152
  61.     [algn]
  62.         1
  63.         1
  64.         0
  65.         0
  66.         0
  67.     [spc]
  68.         17
  69.         0
  70.         1
  71.         0
  72.         0
  73.         1
  74.         100
  75.     [brk]
  76.         4
  77.     [line]
  78.         8
  79.         0
  80.         1
  81.         0
  82.         1
  83.         1
  84.         1
  85.         10
  86.         10
  87.         1
  88.     [spec]
  89.         0
  90.         0
  91.         
  92.         0
  93.         1
  94.         1
  95.         0
  96.         0
  97.         0
  98.         0
  99.     [nfmt]
  100.         24
  101.         1
  102.         2
  103.         ,
  104.         .
  105.         Pts
  106.     Est<\a>ndar
  107.     0
  108.     0
  109. [l1]
  110.     0
  111. [pg]
  112.     2
  113.     49 0 67 0 0 1 0 65535 2 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  114.     86 0 0 1025 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  115. [edoc]
  116. <:#293,9025>Macro by <+!>Charlie Pappas<-!>
  117.  
  118. <:#279,9025>
  119.  
  120. <:#279,9025>function freplace()
  121.  
  122. <:#279,9025>IF IsNewWave()
  123.  
  124. <:#279,9025>    Message("Macro no disponible si se ejecuta en HP New Wave.")
  125.  
  126. <:#279,9025>    Exit Function
  127.  
  128. <:#279,9025>ENDIF
  129.  
  130. <:#279,9025>'ignorekeyboard(2)
  131.  
  132. <:#279,9025>again:
  133.  
  134. <:#279,9025>filledit(9001, strcat$(GetDocPath$(), "*.sam"))
  135.  
  136. <:#279,9025>box = dialogbox(".", "files")
  137.  
  138. <:#279,9025>if box <<<;> 1
  139.  
  140. <:#279,9025>    return 0
  141.  
  142. <:#279,9025>endif
  143.  
  144. <:#279,9025>findit = getdialogfield$(8007)
  145.  
  146. <:#279,9025>replaceit = getdialogfield$(8008)
  147.  
  148. <:#279,9025>if getdialogfield$(8001) = ""
  149.  
  150. <:#279,9025>    message("Seleccione archivos de la lista")
  151.  
  152. <:#279,9025>    goto again
  153.  
  154. <:#279,9025>endif
  155.  
  156. <:#279,9025>cdir = getcurrentdir$()
  157.  
  158. <:#279,9025>dim files(100)
  159.  
  160. <:#279,9025>for i = 1 to 100
  161.  
  162. <:#279,9025>    file = Ucase$(strfield$(getdialogfield$(8001), i, " "))
  163.  
  164. <:#279,9025>    if file = "" or file = -1
  165.  
  166. <:#279,9025>        break
  167.  
  168. <:#279,9025>    endif
  169.  
  170. <:#279,9025>    files(i) = file
  171.  
  172. <:#279,9025>next
  173.  
  174. <:#279,9025>Count = GetOpenFileCount()
  175.  
  176. <:#279,9025>If Count <<1
  177.  
  178. <:#279,9025>    Count = 1
  179.  
  180. <:#279,9025>Endif
  181.  
  182. <:#279,9025>Dim OpenFiles(Count)
  183.  
  184. <:#279,9025>GetOpenFileNames(&OpenFiles)
  185.  
  186. <:#279,9025>
  187.  
  188. <:#279,9025>for j = 1 to i - 1
  189.  
  190. <:#279,9025>    file = files(j)
  191.  
  192. <:#284,9025><:f240,2Times New Roman,255,0,0>    ifopen = 0
  193.  
  194. <:#284,9025><:f240,2Times New Roman,255,0,0>    Count = GetOpenFileCount()
  195.  
  196. <:#284,9025><:f240,2Times New Roman,255,0,0>    IF Count <;> 0
  197.  
  198. <:#284,9025><:f240,2Times New Roman,255,0,0>    DIM Filess(Count)
  199.  
  200. <:#284,9025><:f240,2Times New Roman,255,0,0>    GetOpenFileNames(&Filess)
  201.  
  202. <:#284,9025><:f240,2Times New Roman,255,0,0>    FOR II = 1 to Count
  203.  
  204. <:#284,9025><:f240,2Times New Roman,255,0,0>    f = filess(II)
  205.  
  206. <:#284,9025>    <:f240,2Times New Roman,255,0,0>pathplace = instr(0, f, "\")
  207.  
  208. <:#284,9025><:f240,2Times New Roman,255,0,0>    while pathplace <<<;> 0
  209.  
  210. <:#284,9025><:f240,2Times New Roman,255,0,0>        pathtemp = pathplace + 1
  211.  
  212. <:#284,9025><:f240,2Times New Roman,255,0,0>        pathplace = instr(pathtemp, f,"\")
  213.  
  214. <:#284,9025><:f240,2Times New Roman,255,0,0>    wend    
  215.  
  216. <:#284,9025><:f240,2Times New Roman,255,0,0>    length = len(f)
  217.  
  218. <:#284,9025><:f240,2Times New Roman,255,0,0>    pathplace = right$(f, length  - pathtemp + 1)
  219.  
  220. <:#284,9025><:f240,2Times New Roman,255,0,0>    if  pathplace =  ucase$(file) and ifopen = 0 then
  221.  
  222. <:#284,9025><:f240,2Times New Roman,255,0,0>        ifopen = 1<:f>
  223.  
  224. <:#284,9025><:f240,2Times New Roman,255,0,0>    <:f><:f240,2Times New Roman,255,0,0>endif
  225.  
  226. <:#284,9025><:f240,2Times New Roman,255,0,0>    NEXT    <:f>
  227.  
  228. <:#284,9025>    <:f240,2Times New Roman,255,0,0>endif
  229.  
  230. <:#284,9025><:f240,2Times New Roman,255,0,0>    if ifopen = 0 then<:f>
  231.  
  232. <:#279,9025>        FileOpen(strcat$(cdir, file),  1, "")
  233.  
  234. <:#279,9025>        replace(0, 0, 1024, findit, replaceit)
  235.  
  236. <:#279,9025>        save()
  237.  
  238. <:#279,9025>        fileclose()
  239.  
  240. <:#284,9025>    <:f240,2Times New Roman,255,0,0>else<:f>
  241.  
  242. <:#284,9025>        <:f240,2Times New Roman,255,0,0>selectwindow({file})
  243.  
  244. <:#284,9025><:f240,2Times New Roman,255,0,0>        type("<[>CtrlHome]")
  245.  
  246. <:#284,9025><:f240,2Times New Roman,255,0,0>        replace(0,0, 1024, findit, replaceit)
  247.  
  248. <:#284,9025><:f240,2Times New Roman,255,0,0>        save()
  249.  
  250. <:#284,9025><:f240,2Times New Roman,255,0,0>    endif        <:f>
  251.  
  252. <:#279,9025>next
  253.  
  254. <:#279,9025>end function
  255.  
  256. <:#279,9025>
  257.  
  258. <:#279,9025>DIALOG files
  259.  
  260. -2134376448 10 88 20 184 136 "" "" "B<\z>squeda y sustituci<\s>n en varios archivos"
  261.  
  262. <:#279,9025>FONT 8 "Helv"
  263.  
  264. 6 58 76 8 1000 1342177280 "static" "&Archivos:" 0 
  265.  
  266. 6 6 60 8 1003 1342308352 "static" "&Buscar:" 0 
  267.  
  268. <:#279,9025>6 16 120 12 8007 1350631552 "edit" "" 0 
  269.  
  270. 6 30 60 8 1004 1342308352 "static" "&Sustituir por:" 0 
  271.  
  272. <:#279,9025>6 40 120 12 8008 1350631552 "edit" "" 0 
  273.  
  274. <:#279,9025>6 68 66 64 9001 1352728587 "listbox" "" 0 
  275.  
  276. 138 7 40 14 1 1342373889 "button" "Aceptar" 0 
  277.  
  278. 138 23 40 14 2 1342373888 "button" "Cancelar" 0 
  279.  
  280. <:#279,9025>92 100 48 1 8001 1342177280 "static" "" 0 
  281.  
  282. <:#279,9025>80 68 96 8 7999 1342177280 "static" "" 0 
  283.  
  284. <:#279,9025>END DIALOG
  285.  
  286. <:#279,9025>
  287.  
  288. >
  289.  
  290. [Embedded]
  291. 00005157
  292. >
  293. [macsum] 2
  294. freplace 0 0 18 2
  295. files 1536 0 -1 71
  296. [macse]
  297. 14 freplace
  298. 0 1317
  299. 13
  300. 11 00000107
  301. 0 3 "Macro no disponible si se ejecuta en HP New Wave."
  302. 6 0
  303. 15
  304. 9
  305. 0 268
  306. 13
  307. 0 16 [X] "*.sam"
  308. 13
  309. 0 31 9001 [X]
  310. 0 26 "." "files"
  311. 13
  312. 8 1
  313. 6 1
  314. 5 1
  315. 18 1
  316. 11 00000223
  317. 5 0
  318. 15
  319. 9
  320. 0 27 8007
  321. 13
  322. 8 2
  323. 0 27 8008
  324. 13
  325. 8 3
  326. 0 27 8001
  327. 13
  328. 7 ""
  329. 18 0
  330. 11 00000355
  331. 0 3 "Seleccione archivos de la lista"
  332. 10 00000107
  333. 0 290
  334. 13
  335. 8 4
  336. 5 100
  337. 21 5 [X]
  338. 5 1
  339. 8 6
  340. 5 100
  341. 6 6
  342. 18 2
  343. 12 00000475
  344. 10 00000627
  345. 5 1
  346. 6 6
  347. 3 0
  348. 8 6
  349. 10 00000398
  350. 0 27 8001
  351. 13
  352. 0 20 [X] "{6}" " "
  353. 13
  354. 0 18 [X]
  355. 13
  356. 8 7
  357. 6 7
  358. 7 ""
  359. 18 0
  360. 6 7
  361. 5 -1
  362. 18 0
  363. 1 2
  364. 11 00000598
  365. 10 00000627
  366. 6 6
  367. 6 7
  368. 23 5
  369. 10 00000442
  370. 0 1050
  371. 13
  372. 8 8
  373. 6 8
  374. 5 1
  375. 18 5
  376. 11 00000683
  377. 5 1
  378. 8 8
  379. 6 8
  380. 21 9 [X]
  381. 0 1051 &9
  382. 5 1
  383. 8 10
  384. 6 6
  385. 5 1
  386. 3 1
  387. 6 10
  388. 18 2
  389. 12 00000808
  390. 10 00001524
  391. 5 1
  392. 6 10
  393. 3 0
  394. 8 10
  395. 10 00000720
  396. 6 10
  397. 22 5
  398. 8 7
  399. 5 0
  400. 8 11
  401. 0 1050
  402. 13
  403. 8 8
  404. 6 8
  405. 5 0
  406. 18 3
  407. 11 00001313
  408. 6 8
  409. 21 12 [X]
  410. 0 1051 &12
  411. 5 1
  412. 8 13
  413. 6 8
  414. 6 13
  415. 18 2
  416. 12 00000999
  417. 10 00001313
  418. 5 1
  419. 6 13
  420. 3 0
  421. 8 13
  422. 10 00000921
  423. 6 13
  424. 22 12
  425. 8 14
  426. 0 808 0 "{14}" "\"
  427. 13
  428. 8 15
  429. 6 15
  430. 5 0
  431. 18 1
  432. 11 00001148
  433. 6 15
  434. 5 1
  435. 3 0
  436. 8 16
  437. 0 808 "{16}" "{14}" "\"
  438. 13
  439. 8 15
  440. 10 00001048
  441. 0 14 "{14}"
  442. 13
  443. 8 17
  444. 6 17
  445. 6 16
  446. 3 1
  447. 5 1
  448. 3 0
  449. 0 807 "{14}" [X]
  450. 13
  451. 8 15
  452. 6 15
  453. 0 18 "{7}"
  454. 13
  455. 18 0
  456. 6 11
  457. 5 0
  458. 18 0
  459. 1 1
  460. 11 00001300
  461. 5 1
  462. 8 11
  463. 10 00000964
  464. 6 11
  465. 5 0
  466. 18 0
  467. 11 00001444
  468. 0 16 "{4}" "{7}"
  469. 13
  470. 2 102 1 [X] 1 ""
  471. 2 488 1 0 0 1024 "{2}" "{3}"
  472. 2 103 1
  473. 2 147 1
  474. 10 00001511
  475. 0 796 "{7}"
  476. 0 6 "[16420]"
  477. 2 488 1 0 0 1024 "{2}" "{3}"
  478. 2 103 1
  479. 10 00000773
  480. 6 0
  481. 15
  482. 9
  483. DIALOG files
  484. -2134376448 10 88 20 184 136 "" "" "B·squeda y sustituci≤n en varios archivos" 
  485. FONT 8 "Helv" 
  486. 6 58 76 8 1000 1342177280 "static" "&Archivos:" 0 
  487. 6 6 60 8 1003 1342308352 "static" "&Buscar:" 0 
  488. 6 16 120 12 8007 1350631552 "edit" "" 0 
  489. 6 30 60 8 1004 1342308352 "static" "&Sustituir por:" 0 
  490. 6 40 120 12 8008 1350631552 "edit" "" 0 
  491. 6 68 66 64 9001 1352728587 "listbox" "" 0 
  492. 138 7 40 14 1 1342373889 "button" "Aceptar" 0 
  493. 138 23 40 14 2 1342373888 "button" "Cancelar" 0 
  494. 92 100 48 1 8001 1342177280 "static" "" 0 
  495. 80 68 96 8 7999 1342177280 "static" "" 0 
  496. 00005182
  497.